﻿using DeZhen.DataCollection.Model.Common;
using DeZhen.DataCollection.Model.Enums;
using SqlSugar;
using System;

namespace DeZhen.DataCollection.Model.Entities
{
    /// <summary>
    /// 采集任务明细表
    /// </summary>
    [SugarTable(TableName = "collection_task_detail", TableDescription = "采集任务明细表")]
    public class CollectionTaskDetail : BaseEntity
    {
        /// <summary>
        /// 采集任务表id，关联collection_task表id字段
        /// </summary>
        [SugarColumn(ColumnName = "collection_task_id", ColumnDescription = "采集任务表id，关联collection_task表id字段")]
        public long? CollectionTaskId { get; set; }

        /// <summary>
        /// 采集业务表名
        /// </summary>
        [SugarColumn(ColumnName = "table_name", ColumnDescription = "采集业务表名")]
        public string? TableName { get; set; }

        /// <summary>
        /// 采集业务表中文名
        /// </summary>
        [SugarColumn(ColumnName = "table_cn_name", ColumnDescription = "采集业务表中文名")]
        public string? TableCnName { get; set; }

        /// <summary>
        /// 执行语句（插入本地数据表SQL语句）
        /// </summary>
        [SugarColumn(ColumnName = "execute_sql", ColumnDescription = "执行语句（插入本地数据表SQL语句）")]
        public string? ExecuteSql { get; set; }

        /// <summary>
        /// 执行耗时，单位：ms
        /// </summary>
        [SugarColumn(ColumnName = "excute_consume", ColumnDescription = "执行耗时，单位：ms")]
        public int? ExcuteConsume { get; set; }

        /// <summary>
        /// 数据行数
        /// </summary>
        [SugarColumn(ColumnName = "affect_rows", ColumnDescription = "数据行数")]
        public int? AffectRows { get; set; }

        /// <summary>
        /// 执行状态：0未知，1成功，2失败
        /// </summary>
        [SugarColumn(ColumnName = "status", ColumnDescription = "执行状态：0未知，1成功，2失败")]
        public ExecuteStatusEnum Status { get; set; }
    }
}
